<!-- $Id: addPage.html 122 2011-05-18 09:00:37Z nicholasinlove1986@gmail.com $ -->
<include file="Public:pageheader"/>
<load href="__PUBLIC__/Js/validator.js" />
<load href="__PUBLIC__/Editor/kindeditor.js" />
<load href="__PUBLIC__/Editor/kindsoft-plugin.js" />
<script language="javascript">
/**
* 初始化编辑器
*/
KE.show({
	id : 'posts_content',
	imageUploadJson : '__APP__/Upload/uploadImage',
	fileManagerJson : '__APP__/Upload/fileManager',
	allowFileManager : true,
	width : '100%',
	resizeMode : 1
});

/**
* jQuery
*/
$(function(){

	$('#title').blur(function(){
		//$('#posts_url').val(encodeURIComponent($('#title').val()));
		$('#posts_url').val(encodeURIComponent($('#title').val().replace(/[ ]/g,"-")));
	});
	  
});

/**
* 检查表单输入的数据
*/
function validate() {
	validator = new Validator("theForm");	
	validator.required("posts_title","{$Think.lang.js_posts_title}");
	validator.required("posts_url","{$Think.lang.js_posts_url}");
	validator.required("posts_content","{$Think.lang.js_posts_content}");
	return validator.passed();
}
</script>

<div class="tab-div">
  <div id="tabbar-div">
    <p> <span class="tab-front" id="base-tab">{$Think.lang.tabbar_base}</span><span class="tab-back" id="content-tab">{$Think.lang.tabbar_content}</span><span class="tab-back" id="seo-tab">{$Think.lang.tabbar_seo}</span></p>
  </div>
  <div id="tabbody-div">
    <form action="__URL__/insertPage" method="post" name="theForm"  id="theForm" enctype="multipart/form-data" onSubmit="return validate()">
      <table width="90%" id="base-table">
        <tr>
          <td class="narrow-label">{$Think.lang.posts_title}</td>
          <td><input type="text" name="posts_title" size="45" maxlength="60" id="title"/>
            <span class="require-field">*</span></td>
        </tr>
        <tr class="narrow-label">
          <td class="label"><a href="javascript:showNotice('url');" title="{$Think.lang.notic}"><img src="__PUBLIC__/Images/notice.gif" width="16" height="16" border="0"></a> {$Think.lang.posts_url}</td>
          <td><input type="text" size="45" name="posts_url" id="posts_url" />
            <span class="require-field">*</span><br />
            <span class="notice-span" style="display:block" id="url">{$Think.lang.posts_url_notic}:<br />
            <code style="background:#DDEEF2;">{&blog_domain}?p=123</code><br />
            <code style="background:#DDEEF2;">{&blog_domain}Posts/about-me</code></span> </td>
        </tr>
        <tr>
          <td class="narrow-label">{$Think.lang.posts_author}</td>
          <td><select name="posts_author">
            {$nick_name}
            </select></td>
        </tr>
        <tr>
          <td class="narrow-label">{$Think.lang.posts_allowcom}</td>
          <td><input type="radio" name="posts_allowcom" value="0" />{$Think.lang.no}
            <input type="radio" name="posts_allowcom" value="1" checked />{$Think.lang.yes}
			</td>
        </tr>
		<tr>
          <td class="narrow-label">{$Think.lang.posts_istrack}</td>
          <td><input type="radio" name="posts_istrack" value="0" />{$Think.lang.no}
            <input type="radio" name="posts_istrack" value="1" checked />{$Think.lang.yes}
			</td>
        </tr>
        <tr>
          <td class="narrow-label">{$Think.lang.posts_draft}</td>
          <td><input type="radio" name="posts_draft" value="1" checked />{$Think.lang.posts_draft_1}
            <input type="radio" name="posts_draft" value="0" />{$Think.lang.posts_draft_2}
			</td>
        </tr>
      </table>
      <table id="content-table" style="display: none;" width="90%" align="center";>
        <tr>
          <td class="narrow-label"><textarea id="posts_content" name="posts_content"  style="width:100%;height:285px;" ></textarea></td>
        </tr>
      </table>
      <table id="seo-table"  style="display: none;" width="90%">
        <tr>
          <td width="66%" class="narrow-label"><a href="javascript:showNotice('seoti');" title="{$Think.lang.notic}"><img src="__PUBLIC__/Images/notice.gif" width="16" height="16" border="0"></a> {$Think.lang.posts_seoti}:</td>
          <td width="34%"><input type="text" name="posts_seoti" size="40"/>
            <br />
            <span class="notice-span" style="display:block" id="seoti">{$Think.lang.posts_seoti_notic}</span> </td>
        </tr>
        <tr>
          <td class="narrow-label"><a href="javascript:showNotice('seokw');" title="{$Think.lang.notic}"><img src="__PUBLIC__/Images/notice.gif" width="16" height="16" border="0"></a> {$Think.lang.posts_seokw}:</td>
          <td><input type="text" name="posts_seokw" size="50"/>
            <br />
            <span class="notice-span" style="display:block" id="seokw">{$Think.lang.posts_seokw_notic}</span> </td>
        </tr>
        <tr>
          <td class="narrow-label"><a href="javascript:showNotice('seodesc');" title="{$Think.lang.notic}"><img src="__PUBLIC__/Images/notice.gif" width="16" height="16" border="0"></a> {$Think.lang.posts_seodesc}:</td>
          <td><textarea name="posts_seodesc" rows="6" cols="48"></textarea>
            <br />
            <span class="notice-span" style="display:block" id="seodesc">{$Think.lang.posts_seodesc_notic}</span> </td>
        </tr>
      </table>
      <div class="button-div">
        <input value=" {$Think.lang.submit} " class="button" type="submit">
        <input value=" {$Think.lang.reset} " class="button" type="reset">
		<input type="hidden" name="posts_type" value="2" />
        <input type="hidden" name="act" value="do" />
      </div>
    </form>
  </div>
</div>
<load href="__PUBLIC__/Js/tab.js" />
<include file="Public:pagefooter"/> 